home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / _GUICtrlStatusBarGetTip.au3 < prev    next >
Text File  |  2007-09-08  |  2KB  |  51 lines

  1. Opt("MustDeclareVars", 1)
  2.  
  3. #include <GUIConstants.au3>
  4. #Include <GuiStatusBar.au3>
  5.  
  6. Local $gui, $StatusBar1, $msg, $lbl_Info
  7. Local $a_PartsRightEdge[3] = [100, 200, -1]
  8. Local $a_PartsText[3] = ["New Text", "Tip works when only icon in part or text exceeds part", "Even More Text"]
  9.  
  10. ;================================================================
  11. ; Example 1 - Using AutoIt Control
  12. ;================================================================
  13. $gui = GUICreate("Status Bar Get Tip Text", 500, -1, -1, -1, $WS_SIZEBOX)
  14.  
  15. $StatusBar1 = _GUICtrlStatusBarCreate($gui, $a_PartsRightEdge, $a_PartsText, $SBT_TOOLTIPS)
  16.  
  17. _GUICtrlStatusBarSetIcon($StatusBar1, 1, "shell32.dll", 168)
  18. _GUICtrlStatusBarSetIcon($StatusBar1, 0, "shell32.dll", 21)
  19. _GUICtrlStatusBarSetIcon($StatusBar1, 2, "shell32.dll", 24)
  20.  
  21. _GUICtrlStatusBarSetTip($StatusBar1, 0, "Part 1")
  22. _GUICtrlStatusBarSetTip($StatusBar1, 1, "Tip works when only icon in part or text exceeds part")
  23. _GUICtrlStatusBarSetTip($StatusBar1, 2, "Part 3")
  24.  
  25. $lbl_Info = GUICtrlCreateLabel("Tip Text of 2nd Part: " & _GUICtrlStatusBarGetTip($StatusBar1, 1), 10, 10, 400, 20)
  26.  
  27. GUISetState(@SW_SHOW)
  28.  
  29.  
  30.  
  31. While 1
  32.     $msg = GUIGetMsg()
  33.     Select
  34.         Case $msg = $GUI_EVENT_RESIZED
  35.             _GUICtrlStatusBarResize($StatusBar1)
  36.         Case $msg = $GUI_EVENT_CLOSE
  37.             ExitLoop
  38.         Case Else
  39.             ;;;;;
  40.     EndSelect
  41.     
  42. WEnd
  43. GUIDelete()
  44.  
  45. ;================================================================
  46. ; Example 2 - External Control
  47. ;================================================================
  48. Opt("WinTitleMatchMode", 4)
  49. Local $h_win = WinGetHandle("classname=SciTEWindow")
  50. Local $h_status = ControlGetHandle($h_win, "", "msctls_statusbar321")
  51. ConsoleWrite("Tip Text: " & _GUICtrlStatusBarGetTip($h_status) & @LF)